<?php
$link = mysql_connect('localhost','cs4350','!@'); 
if (!$link) { 
    die('Could not connect to MySQL: ' . mysql_error()); 
}
else {
    echo 'You are connected to the cs4350 database server!</br>';
}
if (!mysql_select_db( 'todo', $link)) {
    die('Aw snap, no database named todo...');
}
else {
    echo 'You are now using the todo database!</br>';
}

$sql = 'UPDATE list SET done="1" WHERE taskID="' . $_GET['task'] . '"';

$updated = mysql_query($sql, $link);


if($updated){
	header('location:home.php?user=' . $_GET['user']);
} else {
	die($sql);
}

mysql_close($link);
?>